package com.gupaoedu.vip.lazy;

/**
 * @Description: 单例模式之懒汉1
 * 在外部需要使用时才初始化
 * 优点：此懒汉式在类需要使用时初始化并才加载
 * 缺点：并发请求下，线程不安全
 * @Author: fuyl
 * @since 2019年03月13日
 * @Version: 1.0
 */
public class LazyOne {

    private LazyOne(){};

    public static LazyOne lazyOne = null;

    public static LazyOne getInstance() {
        if(lazyOne == null) {
            lazyOne = new LazyOne();
        }
        return  lazyOne;
    }
}
